<%-- 
    Document   : coba
    Created on : Feb 10, 2014, 5:31:13 PM
    Author     : Muhammad Dony
--%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="data.IdentitasData"%>
<%@page import="data.AkademikData"%>
<%@page import="database.IdentitasDB"%>
<%@ page contentType="application/vnd.ms-excel" %>
<%-- Set the content disposition header --%>
<% response.setHeader("Content-Disposition", "attachment; filename=\"Rekap Laporan Akademik Penerima Beasiswa CIMB Niaga.xls\""); %>

<div>
    <div>

        <h3 align="center">Rekap Laporan Akademik Penerima Beasiswa CIMB Niaga</h3>
        <table id="table" cellpadding="0" cellspacing="0" border="1" align="center">
            <thead>
                <tr>
                    <th rowspan="2" width="30">No</th>
                    <th rowspan="2" width="300">Nama</th>
                    <th rowspan="2" width="300">Universitas</th>
                    <th colspan="2" width="90">Semester 1</th>
                    <th colspan="2" width="90">Semester 2</th>
                    <th colspan="2" width="90">Semester 3</th>
                    <th colspan="2" width="90">Semester 4</th>
                    <th colspan="2" width="90">Semester 5</th>
                    <th colspan="2" width="90">Semester 6</th>
                    <th colspan="2" width="90">Semester 7</th>
                    <th colspan="2" width="90">Semester 8</th>
                </tr>
                <tr>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                    <th>IPS</th>
                    <th>IPK</th>
                </tr>
            </thead>
            <tbody>
                <%
                    List listidentitas = (List) request.getAttribute("listidentitas");
                    List listakademik = (List) request.getAttribute("listakademik");
                    int n = 1;
                    
                        for (int i = 0; i < listidentitas.size(); i++) {
                            int o=0;
                        IdentitasData identitas = (IdentitasData) listidentitas.get(i);
                        List listakademik1 = new ArrayList();
                        
                        
            %>
                <tr>
                    <th><%=n++%></th>
                    <th><%=identitas.getNama1()%></th>
                    <th><%=identitas.getUniversitas()%></th>
                    <%
                        for(int x = 0; x<listakademik.size(); x++){
                            
                            AkademikData akademik = (AkademikData) listakademik.get(x);
                            if(identitas.getID().equals(akademik.getID())){
                                o++;
                             
                   %>
                            <td><%=akademik.getIPS()%></td>
                            <td><%=akademik.getIPK()%></td>
                            <%}%>
                         <%}%>    
                        <%for(int z=o;z<8;z++){%>
                        <td>--</td>
                        <td>--</td>
                        <%}%>
                       
                 
               <%}%>
                
            </tbody>
        </table>
    </div>

</div>